var MongoClient = require("mongodb").MongoClient
var url = "mogodb://localhost:27017"

MongoClient.connect(url, { useNewUrlParser: true, useUnifiedTopology: true}, function(err, db) {
  if(err) throw err
  var dbo = db.db("laochen")
  let obj = {_id:1, product_id: 154, status:1}
  dbo.collection("orders").insertOne(obj, function(err, res) {
    if(err) throw err
    console.log("文档插入成功")
    db.close()
  })
})



